package com.zsrt.bbu.bank.service.impl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.zsrt.bbu.bank.dao.BankDao;
import com.zsrt.bbu.bank.dao.impl.BankDaoImpl;
import com.zsrt.bbu.bank.service.BankService;
import com.zsrt.common.ResponseEntity;
import com.zsrt.common.entity.Combobox;

/**
 * 
 * @author zsrt
 *
 */


@Service
public class BankServiceImpl implements BankService {

	@Autowired
	private BankDao bankDao;
	

	public BankServiceImpl(){
		System.out.println("--BankServiceImpl--");
	}

	@Override
	public void findAll(Map<String, Object> mp) {
		
		try {
			
			//1 开启事务
			
			System.out.println("--进入业务方法findAll--");
			List<Combobox> list = bankDao.findAll();
			mp.put("data", list);
			mp.put(ResponseEntity.RESULT, ResponseEntity.getSuccessMessage());
			//2 提交事务
			
		} catch (Exception e) {
			//3 回滚事务
			//4 记录日志
			mp.put(ResponseEntity.RESULT, ResponseEntity.getFailureMessage());
			e.printStackTrace();
		}
		
	}



}
